<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../Vue全家桶_stu/03_依赖包/vue.js"></script>
</head>

<body>
    <!-- 数据双向绑定 用来收集表单数据(表单的value) -->
    <div id="root">
        <!-- input输入框 -->
        <input type="text" v-model="text" />
        <!-- 单选按钮 -->
        <input type="radio" name="sex" v-model="xingbie" value="man">男</input>
        <input type="radio" name="sex" v-model="xingbie" value="woman">女</input>
        <!-- 多选按钮 -->
        <p>
            <input type="checkbox" value="eat" v-model="hobby">吃饭</input>
            <input type="checkbox" value="sleep" v-model="hobby">睡觉</input>
            <input type="checkbox" value="play" v-model="hobby">打豆豆</input>
        </p>
        <!-- 下拉框 -->
        <p>
            <select v-model="dropdown">
                <option value="beijing">北京</option>
                <option value="tianjin">天津</option>
                <option value="hebei">河北</option>
            </select>
        </p>
    </div>
    <script>
        const vm = new Vue({
            el: '#root',
            data() {
                return {
                    text: '',
                    xingbie: '',
                    hobby: [],//收集多选框的值必须用数组
                    dropdown: ''
                }
            }
        })
    </script>
</body>

</html>